<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>17.电话号码的字母组合</title>
</head>

<body>

</body>

<script>
    // let numArr = [' ', '', 'abc', 'def', 'ghi', 'jkl', 'mno', 'pqrs', 'tuv', 'wxyz'];
    /**
     * @param {string} digits
     * @return {string[]}
     */
    var letterCombinations = function (digits) {
        let arr = [];
        let numArr = [[''],//0
        [],//1
        ['a', 'b', 'c'],//2
        ['d', 'e', 'f'],//3
        ['g', 'h', 'i'],//4
        ['j', 'k', 'l'],//5
        ['m', 'n', 'o'],//6
        ['p', 'q', 'r', 's'],//7bb
        ['t', 'u', 'v'],//8
        ['w', 'x', 'y', 'z']];//9
        let nums = digits.split("").map(item => numArr[item]);
        let len = nums.length;
        console.log(nums);
        circulation(nums, len);
        return arr;
    };
    function circulation(nums, len) {
        let newArr = [];
        for(let i = 0; i < len.length; i++){
            
        }
        if (len != 0) {
            circulation(nums, len - 1);
        }
    }

    console.log(letterCombinations("324"));//
</script>

</html>